import 'package:syria_sports/localization/app_localization.dart';
import 'package:flutter/material.dart';

import '../core/utils/pref_utils.dart';
import '../data/remote/launcher_url_in_platform.dart';


class UpdateDialogBody extends StatelessWidget {
  final String appLink;
  const UpdateDialogBody({
    Key? key,
    required this.appLink,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: ()async{
        return false;
      },
      child: AlertDialog(
        shadowColor: Colors.grey,
        elevation: 16,
        scrollable: true,
        backgroundColor: Theme.of(context).colorScheme.secondary,
        title: const Text('يوجد تحديث الزامي' ),
        content: const Text('يرجى تحديث التطبيق للمتابعة'),
        actions: [
          TextButton(
            onPressed: () {
              launchSocialMediaAppIfInstalled(url: appLink);
            },
            child: const Text('تحديث' ,
              style: TextStyle(
                color: Colors.red,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
